﻿using System;
using System.Collections.Generic;
using DevExpress.Xpo;
using System.Text;

namespace BusinessObjects
{
    public class CongTy : XPObject
    {
        public CongTy()
            : base()
        {
            // This constructor is used when an object is loaded from a persistent storage.
            // Do not place any code here.
        }

        public CongTy(Session session)
            : base(session)
        {
            // This constructor is used when an object is loaded from a persistent storage.
            // Do not place any code here.
        }

        public override void AfterConstruction()
        {
            base.AfterConstruction();
            // Place here your initialization code.
        }

        //Fields
        /*
        string fMaCongTy = string.Empty;
        [Size(50)]
        public string MaCongTy
        {
            get { return fMaCongTy; }
            set { SetPropertyValue<string>("MaCongTy", ref fMaCongTy, value); }
        }
        */
        string fTenCongTy = string.Empty;
        [Size(500)]
        public string TenCongTy
        {
            get { return fTenCongTy; }
            set { SetPropertyValue<string>("TenCongTy", ref fTenCongTy, value); }
        }
        LinhVuc fLinhVuc;
        [Association(@"CongTyReferencesLinhVuc")]
        public LinhVuc LinhVuc
        {
            get { return fLinhVuc; }
            set { SetPropertyValue<LinhVuc>("LinhVuc", ref fLinhVuc, value); }
        }
        [Association(@"LienHeReferencesCongTy", typeof(LienHe))]
        public XPCollection<LienHe> LienHes { get { return GetCollection<LienHe>("LienHes"); } }
        [Association(@"DiaChiReferencesCongTy", typeof(DiaChi))]
        public XPCollection<DiaChi> DiaChis { get { return GetCollection<DiaChi>("DiaChis"); } }
        [Association(@"CongTyTrongNamReferencesCongTy", typeof(CongTyTrongNam))]
        public XPCollection<CongTyTrongNam> CongTyTrongNams { get { return GetCollection<CongTyTrongNam>("CongTyTrongNams"); } }
    }
}
